import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/cate',
    name: 'cate',
    component: () => import('../views/CateView.vue')
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/goods',
    name: 'goods',
    component: () => import('../views/GoodsList.vue')
  },
  {
    path: '/user',
    name: 'user',
    component: () => import('../views/UserCenter.vue')
  },
  {
    path: '/element',
    name: 'element',
    component: () => import('../views/ElementPlus.vue')
  },
  {
    path: '/render',
    name: 'render',
    component: () => import('../views/RenderView.vue')
  },
  {
    path: '/jsx',
    name: 'jsx',
    component: () => import('../views/JsxView.vue')
  },
  {
    path: '/href',
    name: 'href',
    component: () => import('../views/HrefView.vue')
  },
  {
    path: '/setup',
    name: 'setup',
    component: () => import('../views/SetupView.vue')
  },
  {
    path: '/option',
    name: 'option',
    component: () => import('../views/OptionView.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
